<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
<!-- 载入easyui样式及图标样式  注意该一下路径-->
<link rel="stylesheet" type="text/css"
	href="/Goktech-Bank-System/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="/Goktech-Bank-System/easyui/themes/icon.css">
<!-- 载入jquery支持文件（必须写在其他js文件前）、easyui支持文件、easyui中文支持文件 -->
<script type="text/javascript" src="/Goktech-Bank-System/easyui/jquery.min.js"></script>
<script type="text/javascript"
	src="/Goktech-Bank-System/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="/Goktech-Bank-System/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="/Goktech-Bank-System/common/css/layui.css">
<link rel="stylesheet" href="/Goktech-Bank-System/css/alertDiv.css">
</head>
<body style="height: 100%; margin: 0">
	<div style="padding-top: 5px;">
		<button id="addbtn" class="layui-btn" style="border-radius: 4px"
			onclick="one()">开启年检</button>
			<button id="addbtn" class="layui-btn" style="border-radius: 4px"
			onclick="downNianJianFail()">导出年检数据</button>
			
			<button id="addbtn" class="layui-btn" style="border-radius: 4px"
			onclick="toCount()">年检状态图</button>
	</div>
	<div id="container" style="height: 80%;width:80%;margin-top: 50px;"></div>
	<script type="text/javascript" src="/Goktech-Bank-System/js/echarts.js"></script>
	<script type="text/javascript" src="/Goktech-Bank-System/js/echarts.min.js"></script>
	<script type="text/javascript"
		src="/Goktech-Bank-System/easyui/jquery.min.js"></script>
	<script type="text/javascript"
		src="/Goktech-Bank-System/js/1.8.3_jquery.min.js"></script>
	<script type="text/javascript">
		//encharts官网 https://echarts.baidu.com/
		var dom = document.getElementById("container");
		var arr = [];
		var arr1 = [];
		$.get("/Goktech-Bank-System/nianjian/getStateCount", null, function(
				data) {
			$.each(data, function() {
				var obj = new Object();
				obj.value = this.count;
				switch (this.zt) {
				case "1":
					obj.name = "年检成功"
					break;
				case "2":
					obj.name = "年检失败"
					break;
				case "A":
					obj.name = "信息错误"
					break;
				case "4":
					obj.name = "等待年检"
					break;
				}
				arr1.push(obj.name)
				console.log(obj)
				arr.push(obj);
			});
			console.log(arr)
			var myChart = echarts.init(dom);
			var app = {};
			option = null;
			option = {
				title : {
					text : '年检数据',
					subtext : '年检数据',
					x : 'center'
				},
				tooltip : {
					trigger : 'item',
					formatter : "{a} <br/>{b} : {c} ({d}%)"
				},
				legend : {
					orient : 'vertical',
					left : 'left',
					data : arr1
				},
				series : [ {
					name : '状态分布',
					type : 'pie',
					radius : '55%',
					center : [ '50%', '60%' ],
					data : arr,
					itemStyle : {
						emphasis : {
							shadowBlur : 10,
							shadowOffsetX : 0,
							shadowColor : 'rgba(0, 0, 0, 0.5)'
						}
					}
				} ]
			};

			;
			if (option && typeof option === "object") {
				myChart.setOption(option, true);
			}
		});
		function downNianJianFail() {
			location.href="/Goktech-Bank-System/nianjian/downNianJianFail";
		}
	</script>
</body>
</html>